using SharpGraphT.Graph.Builder;
using SharpGraphT.Util;

namespace SharpGraphT.Graph;

public class DefaultDirectedWeightedGraph<TV, TE> : DefaultDirectedGraph<TV, TE>
    where TE : class, new() {
    private static readonly long SerialVersionUid = -4867672646995721544L;

    public DefaultDirectedWeightedGraph() : this(null,
        SupplierUtil.CreateSupplier<TE>()) { }

    public DefaultDirectedWeightedGraph(Func<TV> vertexSupplier,
        Func<TE> edgeSupplier) : base(vertexSupplier, edgeSupplier, true) { }

    public static GraphBuilder<TV, TE, DefaultDirectedWeightedGraph<TV, TE>>
        CreateBuilder() =>
        new(new DefaultDirectedWeightedGraph<TV, TE>());

    public static GraphBuilder<TV, TE, DefaultDirectedWeightedGraph<TV, TE>>
        CreateBuilder(Func<TE> edgeSupplier) =>
        new(new DefaultDirectedWeightedGraph<TV, TE>(null, edgeSupplier));
}